package com.ruoyi.canteen.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.canteen.mapper.CanteenUserMapper;
import com.ruoyi.canteen.domain.CanteenUser;
import com.ruoyi.canteen.service.ICanteenUserService;

/**
 * 点餐用户Service业务层处理
 * 
 * @author zhangw
 * @date 2021-09-19
 */
@Service
public class CanteenUserServiceImpl implements ICanteenUserService 
{
    @Autowired
    private CanteenUserMapper canteenUserMapper;

    /**
     * 查询点餐用户
     * 
     * @param id 点餐用户主键
     * @return 点餐用户
     */
    @Override
    public CanteenUser selectCanteenUserById(String id)
    {
        return canteenUserMapper.selectCanteenUserById(id);
    }

    /**
     * 查询点餐用户列表
     * 
     * @param canteenUser 点餐用户
     * @return 点餐用户
     */
    @Override
    public List<CanteenUser> selectCanteenUserList(CanteenUser canteenUser)
    {
        return canteenUserMapper.selectCanteenUserList(canteenUser);
    }

    /**
     * 新增点餐用户
     * 
     * @param canteenUser 点餐用户
     * @return 结果
     */
    @Override
    public int insertCanteenUser(CanteenUser canteenUser)
    {
        canteenUser.setCreateTime(DateUtils.getNowDate());
        return canteenUserMapper.insertCanteenUser(canteenUser);
    }

    /**
     * 修改点餐用户
     * 
     * @param canteenUser 点餐用户
     * @return 结果
     */
    @Override
    public int updateCanteenUser(CanteenUser canteenUser)
    {
        canteenUser.setUpdateTime(DateUtils.getNowDate());
        return canteenUserMapper.updateCanteenUser(canteenUser);
    }

    /**
     * 批量删除点餐用户
     * 
     * @param ids 需要删除的点餐用户主键
     * @return 结果
     */
    @Override
    public int deleteCanteenUserByIds(String[] ids)
    {
//        return canteenUserMapper.deleteCanteenUserByIds(ids);
        return 0;
    }

    /**
     * 删除点餐用户信息
     * 
     * @param id 点餐用户主键
     * @return 结果
     */
    @Override
    public int deleteCanteenUserById(String id)
    {
//        return canteenUserMapper.deleteCanteenUserById(id);
        return 0;
    }

    /**
     * 通过openid，更新用户信息
     * @param canteenUser 微信用户信息
     * @return
     */
    @Override
    public int updateUserWxInfo(CanteenUser canteenUser){
        return canteenUserMapper.updateUserWxInfo(canteenUser);
    }

    /**
     * 新增企业点餐用户
     * @param canteenUser
     * @return
     */
    @Override
    public int insertQyCanteenUser(CanteenUser canteenUser) {
        return canteenUserMapper.insertQyCanteenUser(canteenUser);
    }


}
